package cn.kgc.springcloud.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 课工场
 * @date 2024/10/22
 * @description
 */
@RestController
@RequestMapping("sentinel")
public class SentinelController {

    @GetMapping("m1")
    public String method1(){
        long time = System.currentTimeMillis();
        System.out.println("接收到一个请求,处理时间是:"+time);
        return "SentinelController method1 ok";
    }

    @GetMapping("m2")
    public String method2(){

        return "SentinelController method2 ok";
    }


    @GetMapping("m3")
    public String method3(Integer id){

        if (id<0){
             throw  new RuntimeException("参数异常");
        }

        return "SentinelController method2 ok";
    }
}
